﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Transactions {
    import flash.utils.*;
    import GameMode.*;

    public class TSellStoredItem extends TFarmTransaction {

        protected var m_sellAll:Boolean;
        protected var m_gifts:Object;
        protected var m_origin:String;
        private var m_callBackFunc:Function;

        public function TSellStoredItem(_arg1:Object, _arg2:Boolean, _arg3:Function, _arg4:int=-1){
            this.m_gifts = _arg1;
            this.m_sellAll = _arg2;
            this.m_callBackFunc = _arg3;
            this.m_origin = _arg4.toString();
        }
        override public function perform():void{
            signedCall("UserService.sellStoredItem", this.m_gifts, this.m_sellAll, this.m_origin);
        }
        override protected function onComplete(_arg1:Object):void{
            if (_arg1){
                Global.player.gold = (Global.player.gold + _arg1.total);
                if (((_arg1.giftsReset) && ((_arg1.giftsReset == true)))){
                    Global.player.gifts = new Dictionary();
                };
            };
            Global.hud.conditionallyRefreshHUD(true);
            this.m_callBackFunc(_arg1);
            var _local2:GameMode = Global.world.getTopGameMode();
            if ((_local2 is GMObjectMove)){
                Global.world.popGameMode();
            };
        }

    }
}//package Transactions 
